﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ConsoleApplication3.AbstraX;
using System.Diagnostics;
using System.Collections;

namespace ConsoleApplication3
{
    class Program
    {
        static void Main(string[] args)
        {
            var root = new EntitiesRoot();

            foreach (var element in root.RootElements)
            {
                Action<IElement> print = null;

                print = elem =>
                    {
                        Debug.WriteLine(elem.Name);
                        Debug.Indent();

                        elem.ChildElements.ForEach(childelem => print(childelem));

                        Debug.Unindent();
                    };

                print(element);
            }
        }
    }
}
